<template>
  <div>
    <h2 class="titleHeader">主管理员</h2>
    <div class="card" v-if="info.avatar">
      <div class="img">
        <img :src="($urlBase+info.avatar)" alt="">
      </div>
      <h1 style="font-size:16px">超级管理员：{{info.username}}</h1>
      <p style="margin-top:10px">
        <i class="el-icon-phone" @click="open1('手机号',
         `<i class='el-icon-phone' style='color:#409fef;'>
          18803425419
          </i>`)" id="tel">
        </i>
        <i class="el-icon-s-promotion" @click="open1('git仓库',
         `<a href='https://gitee.com/zyqwasd'
         target='_bank'
          style='color:#409fef;'>
          https://gitee.com/zyqwasd
          </a>`)">
        </i>
        <i class="el-icon-share" @click="open1('博客',
         `<a href='https://www.cnblogs.com/qiaomucreate/'
         target='_bank'
         style='color:#409fef;'>
         https://www.cnblogs.com/qiaomucreate/
          </a>`)">
        </i>
      </p>
      <p class="connect">
        <span>电话</span>
        <span>git仓库</span>
        <span>博客</span>
      </p>
      <h1 style="font-size:16px">越努力，越幸运</h1>
      <h1 style="font-size:14px">创建时间： {{info.createTime | createDate}}</h1>
    </div>
  </div>
</template>
<script>
import dayjs from 'dayjs'
export default {
  methods: {
    open1 (title, message) {
      this.$notify({
        title,
        dangerouslyUseHTMLString: true,
        message,
        duration: 0
      })
    }
  },
  data () {
    return {
      info: {}
    }
  },
  filters: {
    createDate (date) {
      return dayjs(date).format('YYYY-MM-DD HH:mm')
    }
  },
  mounted () {
    this.$axios.get('/user/userMain').then(res => {
      this.info = res.data
    })
  }
}
</script>

<style lang="scss" scoped>
.connect {
  width: 180px;
  display: flex;
  justify-content: space-between;
  margin: auto;
  margin-bottom: 20px;
}
//
.card {
  width: 300px;
  height: 450px;
  background: #07182e;
  border-radius: 5px;
  text-align: center;
  color: #f0f0f0;
  font-family: inherit;
  z-index: 1;
  margin: 50px auto;
  padding-top: 70px;
  img {
    width: 100%;
    height: 100%;
  }
  i {
    width: 50px;
    height: 50px;
    font-size: 25px;
    cursor: pointer;
    margin: 10px 10px 0 10px;
  }
}

.img {
  display: flex;
  margin: 0 auto 40px auto;
  width: 105px;
  height: 105px;
  border: 1px solid #f0f0f0;
  border-radius: 50%;
  font-size: 11px;
  justify-content: center;
  align-items: center;
  transition: all 0.5s;
  z-index: 99;
  background-color: #152f50;
  overflow: hidden;
}

p {
  opacity: 0;
  transition: all 0.5s;
}

h1 {
  padding: 10px;
  font-weight: 500;
  font-size: 18px;
}

svg {
  padding: 0 5px;
  cursor: pointer;
}

.card:hover .img {
  transform: scale(1.1);
  border: 1px solid #f0f0f0;
}

.card:hover h1,
.card:hover p {
  opacity: 1;
}
</style>
